package cn.pugle.redis;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;

/**
 * Created by tzp on 7/27/16.<br>
 */
public class SpringDataRedis {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("redis-context.xml");
        RedisTemplate<String, String> redisTemplate = context.getBean(RedisTemplate.class);
        ListOperations listOperations = redisTemplate.opsForList();
        listOperations.leftPush("list","4");

        System.out.println(redisTemplate.boundValueOps("foo").get());
    }
}
